<?php

/**
 * WallConfig form base class.
 *
 * @method WallConfig getObject() Returns the current form's model object
 *
 * @package    faceshop
 * @subpackage form
 * @author     Your name here
 * @version    SVN: $Id: sfDoctrineFormGeneratedTemplate.php 29553 2010-05-20 14:33:00Z Kris.Wallsmith $
 */
abstract class BaseWallConfigForm extends BaseFormDoctrine
{
  public function setup()
  {
    $this->setWidgets(array(
      'page_id'    => new sfWidgetFormInputHidden(),
      'is_active'  => new sfWidgetFormInputCheckbox(),
      'state'      => new sfWidgetFormChoice(array('choices' => array('real-time' => 'real-time', 'random' => 'random', 'lowest-applicants' => 'lowest-applicants'))),
      'frequency'  => new sfWidgetFormInputText(),
      'last_run'   => new sfWidgetFormDateTime(),
      'next_run'   => new sfWidgetFormDateTime(),
      'created_at' => new sfWidgetFormDateTime(),
      'updated_at' => new sfWidgetFormDateTime(),
    ));

    $this->setValidators(array(
      'page_id'    => new sfValidatorChoice(array('choices' => array($this->getObject()->get('page_id')), 'empty_value' => $this->getObject()->get('page_id'), 'required' => false)),
      'is_active'  => new sfValidatorBoolean(array('required' => false)),
      'state'      => new sfValidatorChoice(array('choices' => array(0 => 'real-time', 1 => 'random', 2 => 'lowest-applicants'), 'required' => false)),
      'frequency'  => new sfValidatorInteger(array('required' => false)),
      'last_run'   => new sfValidatorDateTime(array('required' => false)),
      'next_run'   => new sfValidatorDateTime(array('required' => false)),
      'created_at' => new sfValidatorDateTime(),
      'updated_at' => new sfValidatorDateTime(),
    ));

    $this->widgetSchema->setNameFormat('wall_config[%s]');

    $this->errorSchema = new sfValidatorErrorSchema($this->validatorSchema);

    $this->setupInheritance();

    parent::setup();
  }

  public function getModelName()
  {
    return 'WallConfig';
  }

}
